package routers

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
	"month5/client/routers/handler"
)

func LoadApiRouter(r *gin.Engine) {
	r.POST("/login", handler.Login)            //TODO:登录
	r.GET("/eatList", handler.EatList)         //TODO:餐品列表
	r.POST("/upload", handler.Upload)          //TODO:图片优化上传
	r.POST("/alipay/back", handler.PayBack)    //TODO:支付回调
	r.GET("/orderList", handler.OrderList)     //TODO:订单列表
	r.GET("/lookCoupons", handler.LookCoupons) //TODO:查看优惠卷

	r.Use(jwt.JWTAuth("zj"))
	r.POST("/createdOrder", handler.CreatedOrder) //TODO：下单
	r.POST("/addCoupon", handler.AddCoupon)       //TODO：领取优惠卷
}
